package io.renren;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.modules.app.constants.ListConstants;
import io.renren.modules.lucky.dao.AppSysScoreRuleDao;
import io.renren.modules.lucky.entity.AppSysScoreRuleEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * 积分规则
 */
@Component
public class InitParamRunner implements ApplicationRunner {

    @Autowired
    private AppSysScoreRuleDao scoreRuleDao;

    public void run(ApplicationArguments args) {
        //初始化积分规则
        ListConstants.ruleList = scoreRuleDao.selectList(new QueryWrapper<AppSysScoreRuleEntity>().eq("rule_flag",1));
    }

}
